import 'package:flutter/material.dart';

class BottomNavigationDemo extends StatefulWidget {





  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
   return  BottomNavigationDemoState();
  }

}

class BottomNavigationDemoState extends State<BottomNavigationDemo> {
  late int _currentIndex;
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _currentIndex=0;

  }
  @override
  Widget build(BuildContext context) {
    return BottomNavigationBar(items: [
      BottomNavigationBarItem(icon: Icon(Icons.home), label: "home"),
      BottomNavigationBarItem(icon: Icon(Icons.favorite), label: "love"),
    ],
      currentIndex: _currentIndex,
      onTap: (int p){
      setState(() {
        _currentIndex = p;
      });

      },);
  }
}